package com.yanqu.road.server.cmd.activity.langyabang;

import com.yanqu.road.message.YanQuMessage;
import com.yanqu.road.pb.activity.LangYaBangProto;
import com.yanqu.road.server.cmd.base.AbstractCommand;
import com.yanqu.road.server.command.Cmd;
import com.yanqu.road.server.gameplayer.GamePlayer;
import com.yanqu.road.server.gameplayer.module.activity.langyabang.LangYaBangModule;
import com.yanqu.road.server.protocol.ClientProtocol;
import com.yanqu.road.server.protocol.GameProtocol;

//@Cmd(code = GameProtocol.S_LANG_YA_BANG_QUICK_CASE_GAME,desc = "快速金陵风云")
public class LangYaBangQuickCaseGameCmd extends AbstractCommand {
    private int activityId;
    private int caseId;
    private int times;
    @Override
    public boolean parseData(YanQuMessage packet) throws Exception {
        LangYaBangProto.LangYaBangQuickCaseGameReqMsg reqMsg = LangYaBangProto.LangYaBangQuickCaseGameReqMsg.parseFrom(packet.getBytes());
        activityId =reqMsg.getActivityId();
        caseId = reqMsg.getCaseId();
        times =reqMsg.getTimes();
        return true;
    }

    @Override
    public void execute(GamePlayer player, YanQuMessage packet) throws Exception {
        //2023 0510策划说不要扫荡了
        //ret = player.getModule(LangYaBangModule.class).quickLangYaCaseGame(activityId,caseId,times);
    }

    @Override
    public void sendData(GamePlayer player) {
        if (ret != 0){
            LangYaBangProto.LangYaBangQuickCaseGameRespMsg.Builder builder = LangYaBangProto.LangYaBangQuickCaseGameRespMsg.newBuilder();
            builder.setRet(0);
            player.sendPacket(ClientProtocol.U_LANG_YA_BANG_QUICK_CASE_GAME,builder);
        }
    }
}
